{extend name="extra@admin/content"}
{block name="content"}
<style>
.ibox-content{
  overflow-y: scroll;
  overflow-x: hidden;
  height: 500px;
}
</style>
<form class="layui-form layui-box" style='padding:25px 30px 20px 0' action="__SELF__" data-auto="true" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">等级名称</label>
        <div class="layui-input-block">
            <input name="title" value='{$info.title}' required="required"
                   title="请输入等级名称" class="layui-input">
        </div>
    </div>
    <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">颜色</label>-->
        <!--<div class="layui-input-block">-->
            <!--<input name="css_color" value='{$info.css_color}' required="required"-->
                   <!--title="请输入标签颜色" class="layui-input">-->
        <!--</div>-->
    <!--</div>-->
    <div class="layui-form-item">
        <label class="layui-form-label">升级金额</label>
        <div class="layui-input-block">
            <input name="score" value='{$info.score}' required="required"
                   title="请输入升级金额" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">上传图片</label>
            <div class="uploadimage"><input type="hidden" name="logo" {if $info and !empty($info.logo)} value="{$info.logo}" {/if} /></div>
            <a data-file="one" data-field="logo" data-type="png,jpg,jpeg" data-uptype="qiniu" href="javascript:void(0)"
               class="uploadbutton">上传图片</a>
            {if $info and !empty($info.logo)}
            <script>
                $(function(){
                    var img = "{$info.logo}";
                    require(['jquery'], function () {
                        $('[name="logo"]').parent().attr('data-tips-image', this.value).css('backgroundImage', 'url(' + img + ')');
                    });
                });
            </script>
            {/if}
            <script>
                require(['jquery'], function () {
                    $('[name="logo"]').on('change', function () {
                        $(this).parent().attr('data-tips-image', this.value).css('backgroundImage', 'url(' + this.value + ')');
                    });
                });
            </script>
    </div>
    <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">上传图片</label>-->
            <!--<div class="uploadimage"><input type="hidden" name="image" {if $info and !empty($info.image)} value="{$info.image}" {/if} /></div>-->
            <!--<a data-file="one" data-field="image" data-type="png,jpg,jpeg" data-uptype="qiniu" href="javascript:void(0)"-->
               <!--class="uploadbutton">上传图片</a>-->
            <!--{if $info and !empty($info.image)}-->
            <!--<script>-->
                <!--$(function(){-->
                    <!--var img = "{$info.image}";-->
                    <!--require(['jquery'], function () {-->
                        <!--$('[name="image"]').parent().attr('data-tips-image', this.value).css('backgroundImage', 'url(' + img + ')');-->
                    <!--});-->
                <!--});-->
            <!--</script>-->
            <!--{/if}-->
            <!--<script>-->
                <!--require(['jquery'], function () {-->
                    <!--$('[name="image"]').on('change', function () {-->
                        <!--$(this).parent().attr('data-tips-image', this.value).css('backgroundImage', 'url(' + this.value + ')');-->
                    <!--});-->
                <!--});-->
            <!--</script>-->
    <!--</div>-->
    <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">简介</label>-->
        <!--<div class="layui-input-block">-->
            <!--<textarea placeholder="请输入简介" title="请输入简介" class="layui-textarea" name="detail">{$info.detail|default=""}</textarea>-->
            <!--<span style="color:red;">注：输入文字如需换行，请在换行处输入“<br />”</span>-->
        <!--</div>-->
    <!--</div>-->
    <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">等级简介</label>-->
        <!--<div class="layui-input-block">-->
            <!--<textarea name="detail">{$info.detail}</textarea>-->
            <!--<script type="text/javascript">-->
            <!--require(['ckeditor'], function () {-->
                <!--var editor = window.createEditor('[name="detail"]');-->
                <!--// 设置内容-->
                <!--// editor.setData('修改内容');-->
                <!--// 获取内容-->
                <!--var content = editor.getData();-->
                <!--console.log(content);-->
            <!--});-->
            <!--</script>-->
            <!--<script>-->
                <!--layui.use('code', function () {-->
                    <!--layui.code({encode: true});-->
                <!--});-->
            <!--</script>-->
        <!--</div>-->
    <!--</div>-->

    {if condition="!empty($id)"}
        <input type="hidden" name="id" value='{$id}'>
    {/if}

    <div class="hr-line-dashed"></div>
    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>

    <script>window.form.render();</script>
</form>
{/block}

